<?php

namespace plugin\cms\app\enum;

use core\enum\EnumInterface;

enum ContentStatus: int implements EnumInterface
{
    case STATUS_NORMAL  = 1;
    case STATUS_PENDING = 0;
    case STATUS_RECYCLE = -9;
    case STATUS_UNPASS = -1;

    public function title(): string
    {
        return match ($this) {
            ContentStatus::STATUS_NORMAL => '正常',
            ContentStatus::STATUS_RECYCLE => '已删除',
            ContentStatus::STATUS_PENDING => '待审核',
            ContentStatus::STATUS_UNPASS => '未通过',
        };
    }

    public function color(): string
    {
        return match ($this) {
            ContentStatus::STATUS_NORMAL => '#0a6aff',
            ContentStatus::STATUS_RECYCLE => '#a86d00',
            ContentStatus::STATUS_PENDING => '#666666',
            ContentStatus::STATUS_UNPASS => '#990000',
        };
    }
}
